home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2000 #5
/
Amiga Plus CD - 2000 - No. 5.iso
/
Tools
/
Misc
/
InstallerNG
/
developer
/
gui
/
README
next >
Wrap
Text File
|
1999-10-15
|
3KB
|
61 lines
The InstallerNG provides a GUI-API. This API (Aplication Programming
Interface) defines an interface, such that the InstallerNG can have
any GUI. If you want to build a new GUI, you have to write a
shared-library, which has to provide some functions. These functions
may become very complex, because they have to read/write from/to memory,
which is owned by the InstallerNG process. Such memory areas are the
global interpretation environment, which keeps values like the DEFUSER,
LOGFILE, PRETENDMODE etc... Additionally, some functions get a local
environment (like ASKFILE, ASKBOOL, ...), where the parameters, e.g.
the SOURCE, DEST, ad so on for ASKFILE are stored. If you have to access
texts, use the text-array, which comes as an argument for the API function
"igui_InitApp()". Have a look at the example source, which implements a
simple MUI based API.
Furthermore, you find some makros and useful tools/functions. See
the "savagelib" drawer for documentation.
NOTE: be prepared to add some media related functions to the GUI
(see the #?MEDIA functions of the installer); currently I am not
sure, whether I define them as part of the API or not.....
IMPORTANT: if you must allocate memory and cannot free it (see the
igui_AskString function for example) you should use the sav_AllocVec()
function of the savage.lib! this function allocates memory and the
InstallerNG knows about this allocation and frees this memory when
quitting!
RULES and HINTS
===============
- start with a small structure, which describes your private GUI object,
this could hold window-pointers, gadget pointers etc...
now you can write the functions igui_InitApp() and igui_FreeApp()
and, after you have done so, you may start to implement the different
panels (i.e. write the igui_Ask#?() functions and the other stuff)
- your gui could provide a menu; if so, you have to handle this by your
own, the InstallerNG itself does not care for that!
- the GUI has to care for locking and unlocking itself; thus, unlock the
GUI before you have to wait (i.e. before you call igui_QuietWaitApp(),
which is also called by the InstallerNG itself) and lock the GUI before
you return from a function, which modified the GUI (like igui_Ask#?()
or igui_Message() or...)
- have a look at the example source: there you find the documantation for
every API function and additional example source
- never ever write to the arguments like the environment structures or
the text array -- they are read only! the only object you are allowed
to write to is your own custom application structure, which you create
with igui_InitApp() and which comes as argument for all the functions
- handling GUI errors: if anything goes wrong (e.g. OpenWindow() fails)
you must set an error code anywhere in your private structure; return
this error code with igui_Error(), because InstallerNG calls this
function to check for success of any GUI function and quits, if
igui_Error() returns a non-zero result
- every function, which modifies the GUI, should leave the GUI empty, i.e.
with an empty help window (if this is implemented asynchronously, as
recomented) and an empty panel
Have fun,
Jens